package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.service.IWorkerCertificationService;
import com.jzo2o.mvc.model.Result;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * \* User: chy
 * \* Date: 2025/9/26  16:58
 * \* Description:
 * \
 */
@RestController("workerCertificationController")
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端 - 认证相关接口")
@Slf4j
public class WorkerCertificationController {

    @Resource
    private IWorkerCertificationService workerCertificationService;

    /**
     * 服务端提交实名认证申请
     *
     * @param reqDTO
     */
    @PostMapping
    public void submitApplication(@RequestBody WorkerCertificationAuditAddReqDTO reqDTO) {
        log.info("提交认证申请{}", reqDTO);
        workerCertificationService.submitApplication(reqDTO);
    }

    /**
     * 获取认证拒绝原因
     *
     * @return
     */
    @GetMapping("rejectReason")
    public Result<Map<String, Object>> rejectReason() {
        log.info("获取认证拒绝原因");
        Map<String, Object> rejectReason = workerCertificationService.rejectReason();
        return Result.ok(rejectReason);
    }
}
